import "package:mobx/mobx.dart";

part "encyclopedia_store.g.dart";

class EncyclopediaStore = _EncyclopediaStore with _$EncyclopediaStore;

abstract class _EncyclopediaStore with Store {
  @observable
  bool isLoading = false;

  @observable
  ObservableList<String> entries = ObservableList<String>.of([]);

  @action
  Future<void> loadEncyclopedia() async {
    isLoading = true;
    
    // 模拟网络请求
    await Future.delayed(const Duration(seconds: 1));
    
    // 加载百科数据
    entries.clear();
    entries.addAll(["百科条目1", "百科条目2", "百科条目3", "百科条目4", "百科条目5", "百科条目6"]);
    
    isLoading = false;
  }
}
